<?php
class Articles_model extends Admin_Model {

	function __construct(){
		// Config here
		// $this->checkExistField = array();
		// $this->listUploadField = array();
	}

	

	function getByWeek($week){
		$this->db->select('*');
		$this->db->where('week <=', $week);
		$this->db->where('week_to >', $week);
		$this->db->where('status', 1);
		$query = $this->db->get( $this->table);

		if ($query->result()) {
			return $query->row();
		} else {
			return FALSE;
		}
	}
	
	function getListArticleID(){
		$this->db->select('id, week, week_to, title');
		$this->db->where($this->status_name, 1);
		$this->db->order_by("week", "ASC");
		$query = $this->db->get( $this->table);

		if ($query->result()) {
			return $query->result();
		} else {
			return FALSE;
		}
	}
}